package com.fast.admin.configs.system;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Getter
@Setter
@Component("lanyuanConfig")
@ConfigurationProperties(prefix = "lanyuan")
public class LanyuanConfig {
    /**
     * 项目名称
     */
    private String name;

    /**
     * 版本
     */
    private String version;

    /**
     * 版权年份
     */
    private String copyrightYear;

    /**
     * 项目路径路径
     */
    private String profile;

    /**
     * 获ip取地址开关
     */
    private boolean addressEnabled;


    /**
     * 获取导入上传路径
     */
    public String getImportPath() {
        return getProfile() + "/uploadPath/import/";
    }


    /**
     * 获取头像上传路径
     */
    public String getAvatarPath() {
        return getProfile() + "/uploadPath/avatar/";
    }

    /**
     * 获取下载路径
     */
    public String getDownloadPath() {
        return getProfile() + "/uploadPath/download/";
    }

    /**
     * 获取上传路径
     */
    public String getUploadPath() {
        return getProfile() + "/uploadPath/upload/";
    }

    /**
     * 获取上传路径暂存路径
     */
    public String getUploadTempPath() {
        return getProfile() + "/uploadPath/upload/temp/";
    }
}
